package com.bawei.wyg.mycommerce.databinding.single;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import android.os.Bundle;

import com.bawei.wyg.mycommerce.R;
import com.bawei.wyg.mycommerce.databinding.ActivitySingleBinding;

public class SingleActivity extends AppCompatActivity {
    private ActivitySingleBinding binding;
    SingleEntity singleEntity;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_single);
        binding= DataBindingUtil.setContentView(this,R.layout.activity_single);
        singleEntity=new SingleEntity();
        binding.setEntity(singleEntity);
        binding.setSingleClick(new SingleClick());
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        binding.unbind();
    }

    public class SingleClick{
        public void btnClick(){
            singleEntity.setContent("我是猫晴呐~");
        }
    }
}